package io;

import java.io.*;

/**
 * @description: ToDo
 * @author: marin
 * @time: 2020/7/2 15:24
 */
public class FileReaderTest {
    public static void main(String[] args) throws IOException {
        File file =new File("./hello.txt");
        FileReader fileReader = new FileReader(file);
        FileWriter writer = new FileWriter("test2.txt");
        char[] chars = new char[128];
        fileReader.read(chars);
        for (int i = 0; i<chars.length;i++){
            writer.write(chars[i]);
            System.out.println("chars:"+chars[i]);
        }
         for(char c :chars){
           System.out.println("chars:"+c);
            writer.write(c);
            writer.flush();
        }
        writer.close();
        System.out.println(writer.toString());
        fileReader.close();
    }
}
